package com.heima.kafka.consumer;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * 消息消费方
 */
@Component
public class KafkaConsumer {
    //监听某一个topic(队列)
    @KafkaListener(topics = "itheima-topic")
    public void onMessage(String message){

        System.out.println("kafka接收到消息:"+message);

    }

}
